package com.itcam.socket_;

import java.net.InetAddress;
import java.net.InetSocketAddress;

/**
 * Author:Cammy.Wu
 * Date:2024-05-15
 * Description:网络编程
 */

public class Demo02 {
    public static void main(String[] args) {
        InetSocketAddress isa = new InetSocketAddress("192.168.199.217", 8089);
        System.out.println(isa);
        System.out.println(isa.getHostName());
        System.out.println(isa.getPort());

        InetAddress ia = isa.getAddress();
        System.out.println(ia.getHostName());
        System.out.println(ia.getHostAddress());
    }
}
